home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / ref / postquel / append < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.5 KB  |  65 lines

  1. .\" XXX standard disclaimer belongs here....
  2. .\" $Header: /private/postgres/ref/postquel/RCS/append,v 1.6 1992/07/14 05:54:17 ptong Exp $
  3. .SP APPEND COMMANDS 6/14/90
  4. .XA 2 Append
  5. .uh NAME
  6. .lp
  7. append \*- append tuples to a relation
  8. .uh SYNOPSIS
  9. .lp
  10. .(l
  11. \fBappend\fR classname
  12.     \fB(\fR att_name1 \fB=\fR expression1 {\fB,\fR att_name-i \fB=\fR expression-i} \fB)\fR
  13.     [ \fBfrom\fR from_list ] [ \fBwhere\fR qual ]
  14. .)l
  15. .uh DESCRIPTION
  16. .lp
  17. .b Append 
  18. adds instances which satisfy the qualification,
  19. .i qual ,
  20. to 
  21. .i classname .
  22. .i Classname 
  23. must be the name of an existing class.
  24. The target list 
  25. specifies
  26. the values of the fields to be appended to 
  27. .i classname .
  28. The fields may be listed in any order.
  29. Fields of the result class which do not appear in the 
  30. target list
  31. are default a null value.  If the expression for each field is not
  32. of the correct data type, automatic type coercion will be attempted.
  33. .sp
  34. The keyword
  35. .b all
  36. can be used when it is desired
  37. to append all domains of a class to another class.
  38. .uh EXAMPLE
  39. .lp
  40. .nf
  41. .ft C
  42. /* Make a new employee Jones work for Smith */
  43.  
  44. append emp (newemp.name, newemp.salary, mgr = "Smith",
  45.             bdate = 1990 - newemp.age)
  46.     where newemp.name = "Jones"
  47.  
  48. /* same command using the from list clause */
  49.  
  50. append emp (n.name, n.salary, mgr = "Smith",
  51.             bdate = 1990 - n.age)
  52.     from n in newemp
  53.     where n.name = "Jones"
  54.  
  55. /* Append the newemp1 class to newemp */
  56.  
  57. append newemp (newemp1.all)
  58. .ft
  59. .fi
  60. .uh "SEE ALSO"
  61. .sp
  62. .in .5i
  63. postquel(commands), retrieve(commands), define type(commands).
  64.  
  65.